<?
	
	//require_once('../fun/accounts.php');
	require_once('../fun/theories.php');
	$results = GetTheories();

?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Theories | &psi; Psychology Database &psi;</title>
<? include ("../inc/required-links.php") ?>
</head>

<body>
<div id="wrapper">
	<div id="l_l"></div> 
    <div id="left">
		<?php include ('../nav/theories.php') ?>
    </div>
    <div id="main">
		<?php include ('../inc/header.php') ?>
        <div id="t_bg"></div>
        <div id="content">
			<div class="otstup">
            	<div id="main_left">
            		<h1 style="text-align:center;">Theories</h1>
					<div class="corners">
                    	<div class="text">
                    		<a href="create.php?returnUrl=<?=$_SERVER['PHP_SELF']?>" role="button" class="btn btn-mini create-link" data-toggle="modal">+ Add New Theory</a>
                			<table class="table-hover" style="color:black; width:100%; text-align:center;" cellpadding="0" cellspacing="0">
                    			<tr>
                        			<th>Name</th><th>Year</th><th>Actions</th>
                    			</tr>
                   	 		<? while($rs = $results->fetch_assoc()): ?>
                        		<tr>
                            		<td><?=$rs['Name']?></td>
                            		<td><?=$rs['Year']?></td>
                            		<td>
                                		<a class="detail-link" href="details.php?id=<?=$rs['id']?>&returnUrl=<?=$_SERVER['PHP_SELF']?>">Details</a>
                                		| <a class="edit-link" href="edit.php?id=<?=$rs['id']?>&returnUrl=<?=$_SERVER['PHP_SELF']?>">Edit</a> |
                                		<a class="delete-link" href="delete.php?id=<?=$rs['id']?>&returnUrl=<?=$_SERVER['PHP_SELF']?>">Delete</a>
                            		</td>
                        		</tr>
                    		<? endwhile; ?>
                			</table>
                        </div>
                    </div>
                </div>
                <div id="right">
					<?php include ('../inc/cat_box1.php') ?>
					<?php include ('../inc/cat_box2.php') ?>
					<?php include ('../inc/cat_box3.php') ?>
					<?php include ('../inc/cat_box4.php') ?>
					<?php include ('../inc/sn_links.php') ?>
                </div>
        		<div class="clear"></div>
        	</div>
        </div>
        <div class="clear"></div>  
        <div id="foot">
        	<?php include ('../inc/footer.php') ?>
		</div>
		<?php include ('../inc/copywright.php') ?>
        </div>
<div class="clear"></div> 
</div>
</body>
</html>
<? include ("../inc/required-js.php") ?>
